/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */




import java.io.File;
import java.util.*;
import java.io.BufferedReader;
import java.io.FileReader;

import commons.IOhandler;
import commons.DataProcessing;


/**
 *
 * @author TonyLogic
 */
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */




import java.io.File;
import java.util.*;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileInputStream;

import commons.IOhandler;
import commons.DataProcessing;



/**
 *
 * @author TonyLogic
 */
public class SwitchBox {

    /**
     * @param args the command line arguments
     */
    
    
    public static void main(String[] args) {
        // TODO code application logic here
    	
    	   
    	
    	List<File> Files = new ArrayList<File>();

        File parent = new File("G:/Equivital data");         
      
       String inputFile = "F:/Switchbox/Equivital_core_patches/Overzicht_pills+oplaadtijden.xls";

       
       File equivitalPath = new File("/media/trigon/HD-PCTU3/Switchbox/Equivital_core_patches");
       File PillTimeSchema = new File("/media/trigon/HD-PCTU3/Switchbox/Equivital_core_patches/Overzicht_pills+oplaadtijden.xls");
    
      
       String PatientNumber = "003";
      
       
      
       IOhandler.searchForDatFiles(equivitalPath, Files,PatientNumber , false, true);
    
       List<File> aPatientEquivitalFiles = new ArrayList<File>();
    
       for (int i=0;i<Files.size();i++)
       {
    	 String splitPath[] = Files.get(i).getPath().split("/");
    	 if(splitPath[6].contentEquals(PatientNumber)){
    	   
    	   System.out.println(Files.get(i).getPath());
    	   aPatientEquivitalFiles.add(Files.get(i));
    	 }
    	  
       }
       
       DataProcessing.CleanEquivital(aPatientEquivitalFiles,PillTimeSchema, 300, PatientNumber);
    	
      
    	
    	
    }
}
